from common.BasePage1 import BasePage1
from Buiness.Client import Client
class Add_client(BasePage1):
    def __init__(self,driver=None):
        super().__init__(driver)
        self.name_loc = "id,name"
        self.contact_loc = "id,contact"
        self.phone_loc = "id,phone"
        self.email_loc = "id,email"
        self.qq_loc = "id,qq"
        self.depositor_loc = "id,depositor"
        self.type_loc = "id,type"
        self.size_loc = "id,size"
        self.status_loc = "id,status"
        self.level_loc = "id,level"
        self.dizhi_loc = "xpath,/html/body/div/div[1]/div[2]/form/table/tbody/tr[13]/td/div[1]/input"
        self.weizhi_loc = "xpath,/html/body/div/div[1]/div[2]/form/table/tbody/tr[13]/td/div[3]/input"
        self.intension_loc = "id,intension"

    def enter_name(self,nn):
        self.input(self.name_loc,nn)
        self.wait(1)
    def enter_contact(self,c):
        self.input(self.contact_loc,c)
        self.wait(1)
    def enter_phone(self,m):
        self.input(self.phone_loc,m)
        self.wait(1)
    def enter_email(self,e):
        self.input(self.email_loc,e)
        self.wait(1)
    def enter_qq(self,q):
        self.input(self.qq_loc, q)
        self.wait(1)
    def enter_depositor(self,v):
        self.input(self.depositor_loc,v)
        self.wait(1)
    def enter_type(self,t):
        self.dropdown1(self.type_loc,t)
        self.wait(1)
    def enter_size(self, s):
        self.dropdown1(self.size_loc, s)
        self.wait(1)
    def enter_status(self, u):
        self.dropdown1(self.status_loc, u)
        self.wait(1)
    def enter_level(self, l):
        self.dropdown1(self.level_loc, l)
        self.wait(1)
    def enter_dizhi(self,di):
        self.input(self.dizhi_loc,di)
        self.wait(1)
    def enter_weizhi(self,wi):
        self.input(self.weizhi_loc,wi)
        self.wait(1)
    def enter_intension(self,on):
        self.input(self.intension_loc,on)
        self.wait(1)
    def test_Add_client(self,nn="555",c="666",m="789456",e="45613@qq.com",q="999417",v="国家",di="甘肃",wi="美国",on="全额"):
        cl = Client(driver=self.driver)
        cl.test_client()
        self.enter_name(nn)
        self.enter_contact(c)
        self.enter_phone(m)
        self.enter_email(e)
        self.enter_qq(q)
        self.enter_depositor(v)
        self.enter_size(1)
        self.enter_type(1)
        self.enter_status(0)
        self.enter_level(4)
        self.enter_dizhi(di)
        self.enter_weizhi(wi)
        self.enter_intension(on)
if __name__ == '__main__':
    ad=Add_client()
    ad.test_Add_client()